//
//  MGNavigationController.m
//  Pods-MGUIKit_Example
//
//  Created by XXX on 2018/7/28.
//

#import "PTNavigationController.h"

@interface PTNavigationController ()<UINavigationControllerDelegate>

@end

@implementation PTNavigationController

- (void)viewDidLoad {
    [super viewDidLoad];
}

- (BOOL)shouldAutorotate{
    return self.topViewController.shouldAutorotate;
}

- (UIInterfaceOrientationMask)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskLandscapeRight | UIInterfaceOrientationMaskPortrait;
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation{
    return UIInterfaceOrientationPortrait;
}

- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated {
    viewController.hidesBottomBarWhenPushed = self.viewControllers.count > 0 ? YES : NO;
    [super pushViewController:viewController animated:animated];
    
}

@end
